package com.chachazhan.log;

public class LogUtils {

    public static Object[] getLogMessage(int userId, String requestId, String module) {

        String userIdString = "";
        if (userId > 0) {
            userIdString = String.valueOf(userId);
        }
        if (requestId == null) {
            requestId = "";
        }
        if (module == null) {
            module = "";
        }
        return new Object[]{"user_id", userIdString, "request_id", requestId, "module", module};
    }

    public static Object[] getLogMessage(int userId, String requestId) {

        String userIdString = "";
        if (userId > 0) {
            userIdString = String.valueOf(userId);
        }
        if (requestId == null) {
            requestId = "";
        }
        return new Object[]{"user_id", userIdString, "request_id", requestId, "module", ""};
    }

    public static Object[] getLogMessage(int userId) {

        String userIdString = "";
        if (userId > 0) {
            userIdString = String.valueOf(userId);
        }
        return new Object[]{"user_id", userIdString, "request_id", "", "module", ""};
    }

    public static Object[] getLogMessage(String module) {
        if (module == null) {
            module = "";
        }
        return new Object[]{"user_id", "", "request_id", "", "module", module};
    }
}